﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Yamfinder.Data;
using Yamfinder.Service;

namespace Yamfinder.Web
{
    public static class FilterHelpers
    {
        public static void AddGPSLocWithinRange(this LexicalSearchCriteria searchCriteria, string fieldname, double rangeKm, double lat, double lon)
        {
            var filter = new LexicalFilter(fieldname, FilterType.GPSLocWithinRange);
            filter.AddFilterData("rangeKm", rangeKm).AddFilterData("lat", lat).AddFilterData("lon", lon);
            searchCriteria.Filters.Add(filter);
        }
    }
}